import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

import Layout from '../views/layout/Layout'


export const constantRouterMap = [{
    path: '/404',
    component: () =>
      import('@/views/404'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    name: 'home',
    children: [{
      meta: {
        title: '首页',
        icon: 'home'
      },
      path: 'home',
      component: () =>
        import('@/views/home/index')
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/advertisementData',
    name: 'advertisementData',
    meta: {
      title: '广告数据',
      icon: 'STATISTICS'
    },
    children: [{
      meta: {
        title: '广告数据',
        icon: 'STATISTICS'
      },
      path: '/advertisementData',
      component: () =>
        import('@/views/advertisement/data')
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/advertisementRevenue',
    name: 'advertisementRevenue',
    meta: {
      title: '广告收益',
      icon: 'money'
    },
    children: [{
      path: '/advertisementRevenue',
      component: () =>
        import('@/views/advertisement/revenue'),
      meta: {
        title: '广告收益',
        icon: 'money'
      },
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/customManagement',
    name: 'customManagement',
    meta: {
      title: '客户管理',
      icon: 'settings'
    },
    children: [{
      path: '/customManagement',
      component: () =>
      import('@/views/custom/management'),
      meta: {
        title: '客户管理',
        icon: 'settings'
      },
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/noLoginAccount',
    name: 'noLoginAccount',
    hidden : true,
    meta: {
      title: '超过十天没有登陆的客户',
      icon: 'settings'
    },
    children: [{
      path: '/noLoginAccount',
      component: () =>
      import('@/views/common/noLoginAccount'),
      meta: {
        title: '超过十天没有登陆的客户',
        icon: 'settings'
      },
    },
    {
      path: '/noLoginAccount/detail',
      component: () =>
      import('@/views/common/noLoginAccountDetail'),
      meta: {
        title: '超过十天没有登陆的客户',
        icon: 'settings'
      },
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/notSufficientFund',
    name: 'notSufficientFund',
    hidden : true,
    meta: {
      title: '余额不足100元的商户',
      icon: 'settings'
    },
    children: [{
      path: '/notSufficientFund',
      component: () =>
      import('@/views/common/notSufficientFund'),
      meta: {
        title: '余额不足100元的商户',
        icon: 'settings'
      },
    },{
      path: '/notSufficientFund/detail',
      component: () =>
      import('@/views/common/notSufficientFundDetail'),
      meta: {
        title: '余额不足100元的商户',
        icon: 'settings'
      },
    }]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

export default new Router({
  // mode: 'history', //hash
  scrollBehavior: () => ({
    y: 0
  }),
  routes: constantRouterMap

})
